
var masafadzpuasa = new Array();
masafadzpuasa[1] = 19.50-5.70;
masafadzpuasa[2] = 19.50-5.70;
masafadzpuasa[3] = 19.48-5.70;
masafadzpuasa[4] = 19.48-5.70;
masafadzpuasa[5] = 19.48-5.70;
masafadzpuasa[6] = 19.48-5.70;
masafadzpuasa[7] = 19.48-5.70;
masafadzpuasa[8] = 19.48-5.70;
masafadzpuasa[9] = 19.46-5.70;
masafadzpuasa[10] = 19.46-5.70;
masafadzpuasa[11] = 19.46-5.71;
masafadzpuasa[12] = 19.46-5.71;
masafadzpuasa[13] = 19.45-5.71;
masafadzpuasa[14] = 19.45-5.71;
masafadzpuasa[15] = 19.45-5.71;
masafadzpuasa[16] = 19.43-5.71;
masafadzpuasa[17] = 19.43-5.71;
masafadzpuasa[18] = 19.43-5.71;
masafadzpuasa[19] = 19.43-5.71;
masafadzpuasa[20] = 19.41-5.71;
masafadzpuasa[21] = 19.41-5.71;
masafadzpuasa[22] = 19.41-5.71;
masafadzpuasa[23] = 19.40-5.71;
masafadzpuasa[24] = 19.40-5.70;
masafadzpuasa[25] = 19.38-5.70;
masafadzpuasa[26] = 19.38-5.70;
masafadzpuasa[27] = 19.38-5.70;
masafadzpuasa[28] = 19.36-5.70;
masafadzpuasa[29] = 19.36-5.70;
var startpuasa = new Array();
startpuasa[1] = 5.70;
startpuasa[2] = 5.70;
startpuasa[3] = 5.70;
startpuasa[4] = 5.70;
startpuasa[5] = 5.70;
startpuasa[6] = 5.70;
startpuasa[7] = 5.70;
startpuasa[8] = 5.70;
startpuasa[9] = 5.70;
startpuasa[10] = 5.70;
startpuasa[11] = 5.71;
startpuasa[12] = 5.71;
startpuasa[13] = 5.71;
startpuasa[14] = 5.71;
startpuasa[15] = 5.71;
startpuasa[16] = 5.71;
startpuasa[17] = 5.71;
startpuasa[18] = 5.71;
startpuasa[19] = 5.71;
startpuasa[20] = 5.71;
startpuasa[21] = 5.71;
startpuasa[22] = 5.71;
startpuasa[23] = 5.71;
startpuasa[24] = 5.70;
startpuasa[25] = 5.70;
startpuasa[26] = 5.70;
startpuasa[27] = 5.70;
startpuasa[28] = 5.70;
startpuasa[29] = 5.70;
var startbuuka = new Array();
startbuuka[1] = 19.50;
startbuuka[2] = 19.50;
startbuuka[3] = 19.48;
startbuuka[4] = 19.48;
startbuuka[5] = 19.48;
startbuuka[6] = 19.48;
startbuuka[7] = 19.48;
startbuuka[8] = 19.48;
startbuuka[9] = 19.46;
startbuuka[10] = 19.46;
startbuuka[11] = 19.46;
startbuuka[12] = 19.46;
startbuuka[13] = 19.45;
startbuuka[14] = 19.45;
startbuuka[15] = 19.45;
startbuuka[16] = 19.43;
startbuuka[17] = 19.43;
startbuuka[18] = 19.43;
startbuuka[19] = 19.43;
startbuuka[20] = 19.41;
startbuuka[21] = 19.41;
startbuuka[22] = 19.41;
startbuuka[23] = 19.40;
startbuuka[24] = 19.40;
startbuuka[25] = 19.38;
startbuuka[26] = 19.38;
startbuuka[27] = 19.38;
startbuuka[28] = 19.36;
startbuuka[29] = 19.36;
var minitbesahur = new Array();
minitbesahur[1] = 42;
minitbesahur[2] = 42;
minitbesahur[3] = 42;
minitbesahur[4] = 42;
minitbesahur[5] = 42;
minitbesahur[6] = 42;
minitbesahur[7] = 42;
minitbesahur[8] = 42;
minitbesahur[9] = 42;
minitbesahur[10] = 42;
minitbesahur[11] = 43;
minitbesahur[12] = 43;
minitbesahur[13] = 43;
minitbesahur[14] = 43;
minitbesahur[15] = 43;
minitbesahur[16] = 43;
minitbesahur[17] = 43;
minitbesahur[18] = 43;
minitbesahur[19] = 43;
minitbesahur[20] = 43;
minitbesahur[21] = 43;
minitbesahur[22] = 43;
minitbesahur[23] = 43;
minitbesahur[24] = 42;
minitbesahur[25] = 42;
minitbesahur[26] = 42;
minitbesahur[27] = 42;
minitbesahur[28] = 42;
minitbesahur[29] = 42;
var minitberbuka = new Array();
minitberbuka[1] = 30;
minitberbuka[2] = 30;
minitberbuka[3] = 29;
minitberbuka[4] = 29;
minitberbuka[5] = 29;
minitberbuka[6] = 29;
minitberbuka[7] = 29;
minitberbuka[8] = 29;
minitberbuka[9] = 28;
minitberbuka[10] = 28;
minitberbuka[11] = 28;
minitberbuka[12] = 28;
minitberbuka[13] = 27;
minitberbuka[14] = 27;
minitberbuka[15] = 27;
minitberbuka[16] = 26;
minitberbuka[17] = 26;
minitberbuka[18] = 26;
minitberbuka[19] = 26;
minitberbuka[20] = 25;
minitberbuka[21] = 25;
minitberbuka[22] = 25;
minitberbuka[23] = 24;
minitberbuka[24] = 24;
minitberbuka[25] = 23;
minitberbuka[26] = 23;
minitberbuka[27] = 23;
minitberbuka[28] = 22;
minitberbuka[29] = 22;

function ChangeImgSign(){
	var timeout = new Date();
	var tahunfad = timeout.getYear();
	var bulanfad = timeout.getMonth();
	var tarikfad = timeout.getDate();
	var jamwaktu = timeout.getHours();
	if (tahunfad < 1000){
		tahunfad+=1900;
	}
	var minitfad = timeout.getMinutes();
	var saaatfad = timeout.getSeconds();
	var chackimg = document.getElementById('imgsign');
	var divruntime = document.getElementById('runtimefasting');
	var divendtime = document.getElementById('RunTimeClass');
	var ktasebenar = document.getElementById('KebenaranMakan');
	if(tahunfad==2011&&bulanfad==7&&tarikfad<=29){
		var nowstartim = new Date(tahunfad, bulanfad, tarikfad, 5, minitbesahur[tarikfad]);
		var nowtimeend = new Date(tahunfad, bulanfad, tarikfad, 19, minitberbuka[tarikfad]);
		var now = new Date(tahunfad,bulanfad,tarikfad,jamwaktu,minitfad);
		var thetimeleft = (nowtimeend.getHours())-jamwaktu;
		var themunuteleft = (nowtimeend.getMinutes())-minitfad;
		if(themunuteleft<0){
			themunuteleft = (themunuteleft+60)%60;
			thetimeleft-=1;
		}
		if(now<nowstartim||now>=nowtimeend){
			if(chackimg.src!=GambarSelepasBerbuka){
				chackimg.src = GambarSelepasBerbuka;
			}
			document.getElementById('jaminnerlakd').style.color='';
			if(jamwaktu==nowstartim.getHours()&&minitfad==nowstartim.getMinutes()-1&&saaatfad>=50){
				document.getElementById('jaminnerlakd').style.color='#f00';
			}
			if(jamwaktu==nowtimeend.getHours()&&minitfad==nowtimeend.getMinutes()&&alertBukaPuasa==true){
				alert(MesejBerbukaPuasa);
				alertBukaPuasa=false;
			}
			if(now<nowstartim){
					document.getElementById('FadzImsak').style.color=ColorFontTime;
					document.getElementById('FadzTabImsak').style.background=ColorTabTime;
				if(KataKataSelepasDanSebelumBerBuka==true){
					ktasebenar.innerHTML=KataKataSebelumBersahur;
				}
			}
			if(now>=nowtimeend){
					document.getElementById('FadzBuuka').style.color=ColorFontTime;
					document.getElementById('FadzTabBuuka').style.background=ColorTabTime;
				if(KataKataSelepasDanSebelumBerBuka==true){
					ktasebenar.innerHTML=KataKataSelepasBerbuka;
				}
			}
			if(RunTheRunTimeBar==true){
				divendtime.style.display = '';
				divendtime.style.width = (SaizRunTime)+'px';
				divruntime.style.background = WarnaUntukRunTime;
				divendtime.style.background = WarnaUntukEndTime;
			}
		}else{
				document.getElementById('FadzImsak').style.color='';
				document.getElementById('FadzTabImsak').style.background='none';
				document.getElementById('FadzBuuka').style.color='';
				document.getElementById('FadzTabBuuka').style.background='none';
			if(chackimg.src!=GambarSebelumBerbuka){
				chackimg.src = GambarSebelumBerbuka;
			}
			if(jamwaktu==nowstartim.getHours()&&minitfad==nowstartim.getMinutes()&&alertWaktuImsak==true){
				alert(MesejTamatBersahur);
				alertWaktuImsak=false;
			}
			document.getElementById('jaminnerlakd').style.color='';
			if(jamwaktu==nowtimeend.getHours()&&minitfad==nowtimeend.getMinutes()-1&&saaatfad>=50){
				document.getElementById('jaminnerlakd').style.color='#f00';
			}
			if(KataKataSelepasDanSebelumBerBuka==true){
				ktasebenar.innerHTML=KataKataSebelumBerbuka;
			}
			if(RunTheRunTimeBar==true){
				var kont=(jamwaktu+minitfad/60)-startpuasa[tarikfad];
				var jumlahsemuakalilahtu=kont/masafadzpuasa[tarikfad]*SaizRunTime;
				divruntime.style.width = (jumlahsemuakalilahtu%SaizRunTime)+'px';
				divendtime.style.width = (SaizRunTime)+'px';
				divruntime.style.background = WarnaUntukRunTime;
				divendtime.style.background = WarnaUntukEndTime;
				divendtime.style.display = '';
				divruntime.title = (Math.round(((kont/masafadzpuasa[tarikfad]*100)%100)*100)/100)+'%\nada '+thetimeleft+'jam '+themunuteleft+'minit untuk berbuka...';
			}
		}
		if(now<=nowstartim){
			document.getElementById('FadzImsak').innerHTML="5:"+(minitbesahur[tarikfad-1])+" AM";
			document.getElementById('FadzBuuka').innerHTML="7:"+minitberbuka[tarikfad]+" PM";
		}else{
			document.getElementById('FadzImsak').innerHTML="5:"+minitbesahur[tarikfad]+" AM";
			document.getElementById('FadzBuuka').innerHTML="7:"+minitberbuka[tarikfad]+" PM";
		}
	}
	else if(tahunfad==2011&&(bulanfad>=7&&bulanfad<=8)&&tarikfad>=30){
		document.getElementById('HantuJavascriptWidgetBulanPuasa').src='file:///D:/RayaKu%20RayaMu%20Jua/2083646022_1d5c4f2383.jpg';
	}
	if(TableShowWaktuImsakDanBerbuka==true||TunjukGambarRunTimeDanKataKata==true||ClockDigitalWithIslamicCalendar==true||GambarWaktuBerbukaDanWaktuPuasa==true){
		if(GambarWaktuBerbukaDanWaktuPuasa==true){
			window.onload=document.getElementById('imgsign').style.display="inline";
		}
		if(TableShowWaktuImsakDanBerbuka==true){
			window.onload=document.getElementById('TableBukaDanIsak').style.display="block";
		}
		if(TunjukGambarRunTimeDanKataKata==true){
			window.onload=document.getElementById('FadzInneraGaK').style.display="block";
		}
		window.onload=document.getElementById('HantuJavascriptWidgetBulanPuasa').style.display="block";
		setTimeout("ChangeImgSign()", 500);
	}
	document.getElementById('MainTabWaktuBukaDanImsak').innerHTML = MainInnerTabText;
	document.getElementById('FadzTabImsak').innerHTML = TabBerSahurlahSebelum;
	document.getElementById('FadzTabBuuka').innerHTML = TabBerBukalahSelepas;
}
setTimeout("ChangeImgSign()", 100);